<#include "../common/_public.html"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>后 台 登 录</title>
        <link rel="stylesheet" type="text/css" href="${base}/layui/css/myCss/style.css" />
        <link rel="stylesheet" type="text/css" href="${base}/layui/css/layui.css" />
        <link rel="stylesheet" type="text/css" href="${base}/layui/css/myCss/login.css" />
		<script src="${base}/layui/lay/js/modernizr.custom.63321.js"></script>
		<script src="${base}/layui/layui.js"></script>
    </head>
    <body>
        <div class="container">
					
			<header>
				<h1>XXX业务系统</h1>
				<h2>Background Management System Login</h2>
			</header>
            <form class="layui-form" action="${base}/admin/login_toLogin.do" method="post">
                    <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                        <div class="layui-form-item">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                            <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
                        </div>
                        <div class="layui-form-item">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                            <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-col-xs7">
                                    <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                                    <input type="text" name="captcha" id="LAY-user-login-vercode" maxlength="4" lay-verify="required" placeholder="图形验证码" class="layui-input">
                                </div>
                                <div class="layui-col-xs5">
                                    <div style="margin-left: 10px;">
                                        <a ><img src="${base}/images/kaptcha.jpg" class="layadmin-user-login-codeimg"  alt="点击更换" title="点击更换" id="kaptchaImage"></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
                            <input type="checkbox" name="rememberMe" lay-skin="primary" title="记住密码">
                            <a  class="layadmin-user-jump-change layadmin-link layui-from-a"  style="margin-top: 7px;">忘记密码？</a>
                        </div>
                        <div class="layui-form-item">
                            <input class="layui-btn layui-btn-fluid" id="user_login" lay-submit lay-filter="user_login" type="submit" value="登 入"/>
                            <#if errorMsg != ''>
                                <span style="color: red"><i class="layui-icon layui-icon-tips" style="font-size: 16px; color: red;"></i>&nbsp;${errorMsg}</span>
                            </#if>
                        </div>
                        <div class="layui-trans layui-form-item layadmin-user-login-other">
                            <label>社交账号登入</label>
                            <a href="javascript:;"><i class="layui-icon layui-icon-login-qq"></i></a>
                            <a href="javascript:;"><i class="layui-icon layui-icon-login-wechat"></i></a>
                            <a href="javascript:;"><i class="layui-icon layui-icon-login-weibo"></i></a>

                            <a  class="layadmin-user-jump-change layadmin-link layui-from-a" href="${base}/admin/login_toRegistration.do">注册帐号</a>
                        </div>
                    </div>
            </form>
        </div>
    </body>
</html>
<script>
    //Demo
    $(document).ready(function () {
        if (window != top) {
            top.location.href = location.href;
        }
    });
    layui.use('form', function(){
        var form = layui.form,
            $ = layui.$;
        $('#kaptchaImage').click(function () {
            var str = '${request.contextPath}/images/kaptcha.jpg?'+ Math.floor(Math.random()*100);
            // alert(str);
            $('#kaptchaImage').attr('src', str);
        });
    });
    function keyLogin(event){
        if (event.keyCode==13)  //回车键的键值为13
            document.getElementByIdx_x("user_login").click(); //调用登录按钮的登录事件
    }
</script>